<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
onLoad(() => {
  uni.hideLoading()
})
const submitBtn = () => {
  uni.showLoading({
    title: '请稍后',
  })
  uni.getNetworkType({
    success: (res) => {
      uni.hideLoading()
      if (res.networkType === 'none') {
        uni.showToast({
          icon: 'none',
          title: '网络仍不可访问',
        })
      } else {
        uni.reLaunch({
          url: '/pages/index/index',
        })
      }
    },
  })
}
</script>

<template>
  <view style="padding-top: 10vh; text-align: center; font-size: 16px">
    <image
      src="https://image.yueheji.com/YueHeJiApp/image20231211/networkOutage.png"
      mode=""
      style="width: 430rpx; height: 285rpx"
    ></image>
    <view class="BigText"> 网络好像断开了 </view>
    <view class="smaTest" style="margin-top: 10px; margin-bottom: 30px">
      请检查您的网络连接及网络权限
    </view>
    <view
      class="btn"
      @click="submitBtn"
      style="
        background: red;
        color: #fff;
        padding: 10px 20px;
        border-radius: 8px;
        width: 100px;
        margin: 0 auto;
      "
    >
      刷 新
    </view>
  </view>
</template>
